package tech.aistar.corejava.day02;

/**
* @Description:    作用描述:习题
 *
 * 21   22  23  24  25
 * 20   7   8   9   10
 * 19   6   1   2   11
 * 18   5   4   3   12
 * 17   16  15  14  13
 *
* @Author:          lya
* @CreateDate:     2019/7/17 12:58
* @Version:        1.0
*/
public class TestRectDemo {
    public static void main(String[] args) {
        int n = 2;
        int i = 1;
        int sum = 1;
        while (n<1001){
//            i += n;//i = 3
//            sum += i;//sum = 1 + 3
//            i += n;//i = 5
//            sum += i;//sum = 1 + 3 + 5
//            i += n;//i = 7
//            sum += i;//sum = 1 + 3 + 5 + 7
//            i += n;//i = 9
//            sum += i;//sum = 1 + 3 + 5 + 7 + 9
            for(int j = 0;j < 4;j++){
                i += n;
                sum += i;
            }
            n += 2;
        }
        System.out.println(sum);
    }
}
